<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>计算属性-依赖属性的传递</title>
  <script src="vue.js"></script>
</head>
<body>
   <div id="app">

   </div>
   <script>
      let square = {length:2};

      let vm = new Vue({
         data: square,
         el:"#app",
         computed: {
            area(){
                  return this.length * this.length;
            },
            radius(){
                  return Math.sqrt(this.area / Math.PI);
            },
         
         }
      })
      console.log(vm.radius);  // 1.1283791670955126
      vm.length = 20
      console.log(vm.radius);  // 11.283791670955125
   </script>
</body>
</html>
